//
//  ViewController.m
//  JKOCEmoticon
//
//  Created by 王冲 on 2018/2/10.
//  Copyright © 2018年 希爱欧科技有限公司. All rights reserved.
//

#import "ViewController.h"
#import "JKutility.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *content = @"我[em1]不[em3]想[em5]说话。";
    NSMutableAttributedString *attrStr = [JKutility emotionStrWithString:content withFont:20];
    
    // 纯文本的高度
    //CGFloat height = [JKwideHighSize string:content sizeWithFont:[UIFont systemFontOfSize:30] maxSize:CGSizeMake(CIO_SCREEN_WIDTH,1000)].height;
    // 富文本的高度
    CGFloat height = [JKwideHighSize sizeLabelToFit:attrStr width:CIO_SCREEN_WIDTH height:MAXFLOAT].height;
    
    
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 64,CIO_SCREEN_WIDTH, height)];
    label.numberOfLines = 0;
    label.backgroundColor = [UIColor grayColor];
    label.font = [UIFont systemFontOfSize:20.f];
    label.attributedText= attrStr;
    //label.text = content;
    [self.view addSubview:label];
    
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

